<!--
 * @name: 
 * @Author: JiaYing
 * @LastEditors: JiaYing
 * @Date: 2022-08-26 00:04:52
 * @LastEditTime: 2022-08-26 00:32:07
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>eventloop2</title>
  </head>
  <body></body>
</html>

<script>
  console.log("script 1");
  setTimeout(() => {
    console.log("script 1 setTimeout");
  });
  Promise.resolve().then(() => {
    console.log("script 1 Promise");
  });
</script>

<script>
  console.log("script 2");
  setTimeout(() => {
    console.log("script 2 setTimeout");
  });
  Promise.resolve().then(() => {
    console.log("script 2 Promise");
  });
</script>

<script>
  // setTimeout(function () {
  //   console.log(Date.now());
  //   setTimeout(arguments.callee, 1000);
  // }, 1000);
  // setInterval(function () {
  //   console.log(Date.now());
  // }, 1000);
</script>

<!-- <script>
  setTimeout(() => {
    console.log("script 1");
    setTimeout(() => {
      console.log("script 1 setTimeout");
    });
    Promise.resolve().then(() => {
      console.log("script 1 Promise");
    });
  });

  setTimeout(() => {
    console.log("script 2");
    setTimeout(() => {
      console.log("script 2 setTimeout");
    });
    Promise.resolve().then(() => {
      console.log("script 2 Promise");
    });
  });
</script> -->
